<%-- 
    Document   : adminPage
    Created on : Sep 22, 2012, 8:35:03 AM
    Author     : lion
--%>

<%@page import="dao.StudentDao"%>
<%@page import="entities.Student"%>
<%@page import="java.util.Iterator"%>
<%@page import="dao.MemberDao"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <headF
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link  href="../../style.css" rel="stylesheet" type="text/csss"/>
        <script type="text/javascript" src="../../../js/toggle.js"></script>
        <style type="text/css">
             table{
                border-collapse:collapse;
                width: 100%;
                text-align: center;
            }
            table,th, td
            {
                border: 1px solid black;
            }
            th{
                height: 50px;
            }
        </style>
        <title>Admin student</title>
    </head>
    <body>
        <div class="body">
            <%@include file="../../template/header.html" %>
            <%@include file="../../../template/displayMessage.jsp"%>
            <%@include file="sidebar.html"%>
            <div id="contentbox">
                <table>
                    <thead>
                        <tr>
                            <th>Student id</th>
                            <th>Member id</th>
                            <th>Center id</th>
                            <th>Course id</th>
                            <th>Name</th>
                            <th>Address</th>
                        </tr>
                    </thead>
                    <tbody> 
                        <% StudentDao studentDao = new StudentDao();
                            for (Iterator it = studentDao.getListStudent().iterator(); it.hasNext();) {
                                Student s = (Student) it.next();
                                String url = "addStudent.jsp?studentid=" + s.getStudentid();%>
                        <tr>
                            <td><a href=<%=url%>><%=s.getStudentid()%></a></td>
                            <td><%=s.getMemberid() %></td>
                            <td><%=s.getCenterid() %></td>
                            <td><%=s.getCourseid() %></td>
                            <td><%=s.getName() %></td>
                            <td><%=s.getAddress() %></td>
                        </tr> 

                        <%  }%>
                    </tbody>
                </table>



            </div>
            <div class="clear"></div>
            <%@include file="../../../template/displayUser.jsp" %>
            <%@include file="../../template/footer.html" %>
        </div>
    </body>
</html>
